package com.lvyq.javaprint.exception;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author lvyq 全局缓存
 * @version 1.0
 * Create by 2024-12-17 15:05
 */
public class GlobalCache {

    private static final Map<String, Object> cache = new ConcurrentHashMap<>();

    private GlobalCache() {
        // 私有构造函数防止实例化
    }

    public static void put(String key, Object value) {
        cache.put(key, value);
    }

    public static Object get(String key) {
        return cache.get(key);
    }

    public static void remove(String key) {
        cache.remove(key);
    }
}